package com.monochromebytes.mononet.packet;

import java.io.IOException;

/**
 * A listener interface for UDPSocket objects.
 * 
 * The listener will be informed about opened and closed sockets.
 */
public interface UDPSocketListener {

    /**
     * Will be invoked when a UDPSocket object, the listener is observing, has been
     * closed.
     * 
     * @param socket
     *            The socket that has been closed.
     * @param e
     *            The Exception that was thrown or null.
     */
    public void socketClosed(UDPSocket socket, IOException e);

    /**
     * Will be invoked when a UDPSocket object, the listener is observing, has been
     * openend.
     * 
     * @param socket
     *            The socket that has been opened.
     */
    public void socketOpened(UDPSocket socket);
}
